Skip to content

Conversation

@Bentroen
Copy link
Member

@Bentroen Bentroen commented Dec 29, 2025

Overview

This pull request implements all changes detailed in #67, effectively concluding the implementation of #44.

Closes #44, closes #67

Notes

Changes

Search bar

  • Adds search bar in the navbar component.
  • Removes manual handling of keyboard events (such as Enter) in favor of using native web functionality.
  • Uses type=search, displaying a conventional clear button in WebKit browsers.
  • Disables auto-complete, auto-correct, and auto-capitalize.
  • Refines visual style.

Search page

  • Implements nuqs for search param state management, greatly simplifying the search logic.
  • Adds sort field dropdown with "Recent", "Popular", "Duration", "Play count", and "Note count".
  • Adds order toggle button:
    • The button is contextual, displaying an A-Z/Z-A variant for text fields, and 1-9/9-1 variant for numeric fields.
    • Toggles between ascending and descending order.
  • Removes instances of magic strings (asc, title) in favor of importing the project-wide enum definitions (SongOrderType.ASC, SongSortType.TITLE).
  • Simplifies page header to display only a lean, sleek result count.
  • Adjusts the UI for no songs returned to be consistent with the 'My songs' page.
  • Simplifies the indicator for the end of results to be consistent with the homepage.
  • Removes all loading overlays and text, leaving only skeleton loading cards, to be consistent with the homepage.
  • Removes every public reference to filtering (implementation postponed as per Plan of action for song search release #67). Closes Remove access to the filtering UI in the frontend #69.

Song API

  • Reformulates many SongService methods with a single querySongs method, which features:
    • Sorting (recent, random, play-count, note-count, title, duration)
    • Ordering (asc, desc)
    • Filtering (category)
    • Pagination (page, limit)
  • Implements many of the sort options above, which were missing before.
  • Correctly returns the total result count instead of only the length of the returned page.

Database

  • Adds indices for optimizing some particular queries:
    • stats.duration
    • stats.noteCount
    • visibility + createdAt (compound)
    • category + createdAt (compound)
    • playCount skipped due to updating very often

Other changes

These should have been committed separately but they have been revamped mostly as part of necessary changes, so they have also been included here.

  • Includes "bradlc.vscode-tailwindcss, fill-labs.dependi and gruntfuggly.todo-tree as recommended extensions.
  • Associates *.css and *.scss files with Tailwind CSS so VS Code properly recognizes directives such as @apply.
  • Fix page scrollbar rendered as invisible.
  • Returned a few hardcoded colors in the globals.css stylesheet to their Tailwind classes.
  • Return the page's body font to Lato.
  • Adjusts navbar icon so the surface areas for both the tooltip and icon hover effects match (using group-hover).

It's not the focus, the content is - we can make it as simple and unobtrusive as possible.
Removed loading overlay appearing during a filter or query change.

Removed separate skeleton loading component tree in favor of making each leaf component aware of its state and capable of displaying itself as a skeleton (WIP), as recommended by `react-loading-skeleton`.

See:
https://github.com/dvtng/react-loading-skeleton#dont-make-dedicated-skeleton-screens
Makes it consistent with 'My songs'.
(shh... don't tell anyone... but... the three dots icon already serves this purpose!!)
We've had Next.js complain about importing tons of stuff from the `@nbw/database` module into the client bundle, even though we already imported `SongPreviewDtoType` from that package before. I've decided to inline the enums and add a TODO so we can look deeper into that issue later. That's still better than going back to the magic strings :)
Replaces and combines the functionality of methods `getSongsByCategory`, `getRecentSongs` and `searchSongs` into a generic `querySongs` method that supports all parameters.
The up-pointing arrows had to be read bottom-up, which was counterintuitive.
@Bentroen Bentroen marked this pull request as ready for review December 31, 2025 02:22
@Bentroen Bentroen merged commit 2d5dc2e into develop Dec 31, 2025
0 of 2 checks passed
@Bentroen Bentroen deleted the fix/ssr-search branch December 31, 2025 02:30
This was linked to issues Dec 31, 2025
@Bentroen Bentroen removed a link to an issue Dec 31, 2025
@Bentroen Bentroen linked an issue Dec 31, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants